#pragma once
#include "pgl\mfc\PGLCustomEvent.h"
#include "TestPGL\PGLLineContainer.h"
#include "pgl/shape/PGLGeoPoint.h"
#include "pgl/shape/PGLGeoLine.h"

class PGLMFC_EXT_CLASS CPGLAddPointEvent :
	public CPGLCustomEvent
{
private:
	std::vector<float>* m_Vx;
	std::vector<float>* m_Vy;
	std::vector<float> m_tVx;
	std::vector<float> m_tVy;
	static long m_id;
	static long m_tid;
	CPGLGeoLineDPtr m_curline;
public:
	PGLMFC_DECLARE_EVENT(CPGLAddPointEvent, CPGLPropEvent);

	CPGLAddPointEvent():m_Vx(new std::vector<float>),m_Vy(new std::vector<float>),m_curline(new CPGLGeoLineD)
	{
		m_tVx=std::vector<float>(2);
		m_tVy=std::vector<float>(2);
	}
	~CPGLAddPointEvent()
	{
		if(m_Vx){delete m_Vx;m_Vx=0;}
		if(m_Vy){delete m_Vy;m_Vy=0;}
	}
	virtual void OnLButtonDblClk(UINT nFlags,CPoint point);
	virtual void OnLButtonDown( UINT nFlags, CPoint point );
	virtual void OnMouseMove( UINT nFlags, CPoint point );
	void RemoveObject(long id);
	CPGLObjectPtr GetObject(long id);
	CPGLGeoPointDPtr AddPoint(CPoint pt);
};










